-
-
Notifications
You must be signed in to change notification settings - Fork 0
feat: add ANSI color output following GitHub CLI conventions #30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Stack
Managed by gh-stack |
Add colored terminal output to improve readability and user experience, following the GitHub CLI Primer color guidelines. - Add `internal/style` package using `mgutz/ansi` for ANSI colors - Respect `NO_COLOR`, `CLICOLOR`, and TTY detection - Apply semantic colors: green (success), red (errors), yellow (warnings), cyan (branches), magenta (merged), gray (muted), bold (headers) - Add icons: ✓ (success), ✗ (failure), ! (warning) - Update all cmd files and tree formatting with color support - Add `.claude/rules/colors.md` documenting the color scheme Co-authored-by: Cursor <cursoragent@cursor.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Adds a centralized terminal styling layer and applies it across command output to improve readability while respecting standard color/TTY conventions.
Changes:
- Introduces
internal/stylewith semantic styling helpers (success/error/warn/branch/merged/muted/bold) and ✓/✗/! icons. - Threads optional styling into tree formatting and updates most
cmd/*user-facing output to use the new style helpers. - Documents the color/icon scheme in
.claude/rules/colors.md.
Reviewed changes
Copilot reviewed 16 out of 16 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| internal/tree/tree.go | Adds optional *style.Style to FormatOptions and applies styling to branch display. |
| internal/style/style.go | New package implementing semantic color + icon helpers with NO_COLOR/TTY behavior. |
| cmd/unlink.go | Styles success output and branch name. |
| cmd/undo.go | Styles undo flow output (muted, bold, branch, warning icon). |
| cmd/sync.go | Styles warnings/success/dry-run output and threads style through helpers. |
| cmd/submit.go | Styles submit phases, PR operations output, warnings, and prompts. |
| cmd/orphan.go | Styles orphan success output and branch names. |
| cmd/log.go | Styles porcelain/table output and threads style into tree formatting. |
| cmd/link.go | Styles success output and branch name. |
| cmd/init.go | Styles init output and trunk display. |
| cmd/create.go | Styles create output and commit confirmation. |
| cmd/continue.go | Styles continue output and completion messages. |
| cmd/cascade.go | Styles cascade output, conflict output, and undo snapshot logging. |
| cmd/adopt.go | Styles adopt success output and branch/parent display. |
| cmd/abort.go | Styles abort warnings and completion output. |
| .claude/rules/colors.md | Adds documentation for the color/icon conventions and environment behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Pass style instance to saveUndoSnapshotByName instead of creating new one - Fix SuccessMessage newline placement in sync command - Remove undocumented ℹ icon from init command Co-authored-by: Cursor <cursoragent@cursor.com>
Add colored terminal output to improve readability and user experience,
following the GitHub CLI Primer color guidelines.
internal/stylepackage usingmgutz/ansifor ANSI colorsNO_COLOR,CLICOLOR, and TTY detectioncyan (branches), magenta (merged), gray (muted), bold (headers)
.claude/rules/colors.mddocumenting the color scheme